Object.classPrototype.hasOwnProperty

Instance of

Function

Parameters

key /*String*/

Return value

/*Boolean*/

Description

Checks whether the object has own property.

Example

let obj;
obj.addProperty("first", 1);
console.write(obj.hasOwnProperty("first"), " ", obj.hasOwnProperty("second"));

Expected output

true false